<?php

class UpdateAction extends Action {

    public function update(){
		if(isset($_GET['id'])){
    	$i_id = intval($_GET['id']);
    	$item = new Model('Item');
    	$list = $item->where("item_id='$i_id'")->select();
    	$update = new Model('Cate');

    	$cate = $update->select();
    	$this->assign('i_id',$i_id);
    	$this->assign('list',$list);
    	$this->assign('cate',$cate);
    	$this->display();
    	}
    }

    public function insert(){
    	$item = new Model('Item');
    	$i_id = $_GET['id'];
    	$list = $item->create();
    	$item->where("item_id='$i_id'")->save($list);
    	$this->redirect('update',array('id'=>$i_id),1,'页面跳转中~~~');
    }
}
?>